﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
///DotNetTextBoxEditShow 的摘要说明
/// </summary>
public class DotNetTextBoxEditShow:BaseEditShowField
{
    public DotNetTextBoxEditShow()
    {
        //
        //TODO: 在此处添加构造函数逻辑
        //
    }

    public override IEnumerable<System.Web.UI.Control> GetThisTypeControl(ConfigColumns cCol, string value, bool isEdit)
    {
        DotNetTextBox.WebEditor ctrl = new DotNetTextBox.WebEditor();
        
        ctrl.ID = cCol.ColumnName + "_EditShow";
        ctrl.UploadFolder = "../uploads/";
        ctrl.systemFolder = "DotNetTextBox/";
        ctrl.MenuConfig = "etong.config";
        ctrl.UploadConfig = "etong.config";
        ctrl.Skin = "skin/xp/";

        ctrl.Width = new System.Web.UI.WebControls.Unit(800);
        if (!string.IsNullOrEmpty(cCol.EditShowTextBoxWidth))
        {
            ctrl.Width = new System.Web.UI.WebControls.Unit(cCol.EditShowTextBoxWidth);
        }

        if (isEdit)
        {
            ctrl.Text = value.DecodeScript();
        }
        else
        {
            ctrl.Text = cCol.AddShowDefaultValue;
        }

        yield return ctrl;
    }
}
